#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 100100;
int n, a[N];
int s[N], ans;
struct bit {
  int tree[N];
  int lowbit(int x) { return x & -x; }
  void update(int x, int y) {
    while (x <= n) {
      tree[x] += y;
      x += lowbit(x);
    }
  }
  int query(int x) {
    int ret = 0;
    while (x) {
      ret += tree[x];
      x -= lowbit(x);
    }
    return ret;
  }
} t;
signed main() {
  scanf("%lld", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &a[i]);
    a[i]++;
  }
  for (int i = 1; i <= n; ++i) {
    int x = n - a[i] + 2;
    s[a[i]] += t.query(x - 1);
    t.update(x, 1);
  }
  printf("0\n");
  for (int i = 2; i <= n; ++i) {
    ans += s[i - 1];
    printf("%lld\n", ans);
  }
}
